All request should be done to master node: http://master/
All functions return response in JSON format.
Minimum response is:
{"error":"","code":200}
"error" - error message for user, if something wrong
"code" - code of current operation (described in "Response code" chapter)
200 Ok
400 Incorrect request
401 Unauthorized access
403 Forbidden
404 Method not found
500 Internal error
600 Password expired, only 'changePassword' function is available
To get current HTTP API version
GET /api/call/version
If you are receive "404 Not Found" then you should use old Stratus HTTP API documentation.
Content-Type: application/json
{"api":1.5,"error":"","code":200}
From version 1.4
To every GET, POST request you should add "X-token" header which is in every response cookie "token". First token, to access all other functions in system, you can get from getLoginInfo function, which does not require "X-token" header.
GET /api/call/getAttributes
200
Content-Type: application/json
{"list":{"ARCHSTATE":"off","NAME":"some name"},"type":"camera","error":"","code":200}
obj Required, Integer, object id
GET /api/call/getObjectList
examples:
Get list of roles for current user:
GET /api/call/getObjectList?type=roleGet list of sets in role:
GET /api/call/getObjectList?type=set&roleid=31Get list of objects in set:
GET /api/call/getObjectList?setid=14
200
Content-Type: application/json
{"list":[{"obj":"102","udid":"DC102","name":"Axis 241S","description":"","location":"","otype":"D","subtype":"C","protected":"0","permission":"MM","credentials":"LVvApaeDMrCSPsmxLVvApaeDMrCSPsmx","attributes":{"DEVICETYPE":"CAMERA","DEVID":"102","OBJID":"102","STATUS":"ON"}},{"obj":"109","udid":"DC109","name":"Axis Q7404","description":"","location":"","otype":"D","subtype":"C","protected":"0","permission":"MM","credentials":"LVvApaeDMrCSPsmxLVvApaeDMrCSPsmx","attributes":{"DEVICETYPE":"CAMERA","DEVID":"102","OBJID":"102","STATUS":"ON"}}],"error":"","code":200}
parentObj Optional, int|null, filter by parent obj id
childObj Optional, ,
type Optional, String, type of objects in list. Supported types are: camera, audio, node, role, set, user
withAttributes Optional, Boolean, If "true", then object list will be returned with attributes list
withBlocks Optional, Boolean, return with blocks
withCredentials Optional, Boolean, return with credentials, only for set
objList Optional, Array JSON, filter by obj id
setid Optional, int|null, filter by set id
roleid Optional, int|null, filter by role id
userid Optional, int|null, filter by user id
nodeid Optional, int|null, filter by node id
isAll Optional, Boolean, return all objects with type user, role or set without filtering based on credentials management
filterAttributeList Optional, Array JSON, if withAttributes=true then return only attributes from list
filterAttribute Optional, String, Name of filtered attribute. May be used in pair with $filterMask
filterMask Optional, String, Mask of filtered attribute value. May be used in pair with $filterAttribute
GET /api/call/authorizationManager
200
Content-Type: application/json
{"result":{"authid":"c99dbbab890856416159524013565b653023","url":"rtsp:\/\/192.168.0.117:8554\/xmedia?dev=102&objid=102","param":{"MEDIATRANSPORT":"tcp","DEVICETYPE":"C","TIMEZONE":"UTC","FRAMERATE":"4","PIXELASPECT_RATIO":"auto","POSITIONCTL":"Axis"}},"error":"","code":200}
objid Required, Integer, camera object id
streamtype Required, String, type of stream, can be 'live', 'archive', 'snapshot'
player Optional, ,
analytics Optional, ,
GET /api/call/getCameraDowntime
200
Content-Type: application/json
{"error": "","code":200,"list":{"101":{"downtime":250,"details":[{"start":1411060120,"end":1411060150,"status":3},{"start":1411060200,"end":1411060420,"status":2}]},"101" : {"downtime":12,"details":[{"start":1411061218,"end":1411061230,"status":1 }] } }}
objList Required, Array JSON, list of obj id's
startTime Required, Integer, Unix timestamp in seconds
endTime Required, Integer, Unix timestamp in seconds
status Optional, int|null, Camera status to filter by (0 - on, 1 - off, 2 - off by schedule, 3 - broken)
details Optional, Boolean, If "true" all downtime intervals for specified period will be returned, otherwise only total downtime duration
GET /api/call/getCameraDowntimeSummary
200
Content-Type: application/json
{"list":{"101":{"1414882800":{"3":27}},"103":{"1414882800":{"3":47,"1":185}}},"error":"","code":200}
objList Required, Array JSON, list of obj id's
startTime Required, Integer, Unix timestamp in seconds
endTime Required, Integer, Unix timestamp in seconds
granularity Required, String, hour/day/month
POST /api/call/addObject
200
Content-Type: application/json
{"error":"","obj":106,"code":200}
type Required, String, type of added object. Supported types are: camera
attributes Required, Array JSON, JSONobject list of default values for new created object
setid Optional, ,
nodeid Optional, ,
POST /api/call/deleteObject
200
Content-Type: application/json
{"error":"","code":200}
objList Required, Array JSON, list of obj id's for delete
POST /api/call/setAttributes
200
Content-Type: application/json
{"error":"","code":200}
obj Required, Integer, object id
attributes Required, Array JSON, JSONobject list of attributes
GET /api/call/getStorageUsage
200
Content-Type: application/json
{"list":{"106":{"storageUsage":"","unit":"MB\/hour"}},"error":"","code":200}
objList Required, Array JSON, list of objects ids
granularity Required, String, can be hour, day
GET /api/call/getStorageUsageTotals
200
Content-Type: application/json
{"list":{"106":{"totalStorageUsage":44793328,"oldestTime":1373241600}},"error":"","code":200}
objList Required, Array JSON, list of objects ids
GET /api/call/getStorageUsageSpread
200
Content-Type: application/json
{"list":{"106":[{"storageUsage":"26436","timestamp":1373241600},{"storageUsage":"13590072","timestamp":1373328000},{"storageUsage":"21695872","timestamp":1373414400},{"storageUsage":"9480948","timestamp":1373500800}]},"error":"","code":200}
objList Required, Array JSON, list of objects ids
GET /api/call/getStorageCoverage
200
Content-Type: application/json
{"list":{"119":{"1373029740":"100","1373029800":"100","1373029860":"100","1373029920":"100","1373029980":"100","1373030040":"100","1373030100":"100","1373030160":"100","1373030220":"100","1373030280":"100","1373030340":"100","1373030400":"100","1373030460":"100","1373030520":"63"}},"error":"","code":200}
objList Required, Array JSON, list of obj id's
startTime Required, Integer, Unix timestamp in seconds
endTime Required, Integer, Unix timestamp in seconds
granularity Required, String, min, hour, day
streamNumber Optional, Integer, 1 - full image, 0 - digest
GET /api/call/getSystemStatus
200
Content-Type: application/json
{"status":"CRITICAL","description":"CRITICAL: System in a CRITICAL state. See details for more information.","reasons":["Video Archive loss detected 1 minutes ago"],"error":"","code":200}
status can be: ONLINE, OFFLINE, STARTING, STOPPING, BROKEN, CRITICAL, ALERT
description - short description about status
reasons - list of reasons about status
from version 1.5
GET /api/call/getAvatarStatus?obj=101
200
Content-Type: application/json
{"status":"OFFLINE","description":"OFFLINE: The application is not running (OFFLINE state). Please contact your System Administrator.","error":"","code":200}
status can be: ONLINE, OFFLINE
description - short description about status
obj Required, ,
GET /api/call/getServerTime
200
Content-Type: application/json
{"servertime":1373554305,"error":"","code":200}
GET /api/call/getLoginInfo
200
Content-Type: application/json
{"loginInfo":{"encryptionKey":"daa604a6799aeb543a595d812c7c8c018fb74e6c91d5cc2ace33d903153482fa","loginTTL":5},"error":"","code":200}
GET /api/call/logout
200
Content-Type: application/json
{"error":"","code":200}
GET /api/call/version
200
Content-Type: application/json
{"api":1.3,"error":"","code":200}
POST /api/call/login
200
Content-Type: application/json
{"DEFAULT_ROLE":31,"parameters":{"token":"65bdb82c1ea1bbc2e5cb6f6932974ca909038fff4e7aa84c950048a269ef0e9c"},"error":"","code":200}
name Required, String, user name
credentials Required, String, sha512(${encryptionKey} + sha512(${password}) + ${encryptionKey})
password Optional, String, password for LDAP login (do not use for now)